package p2pfileshare;

import java.awt.Component;
import java.io.File;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.plaf.metal.MetalLookAndFeel;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.JTableHeader;
import javax.swing.table.TableCellRenderer;
import net.jxta.share.ContentAdvertisement;

//this is Main Frame and it handles the Application start up and also initialisation of all
//object that are needed in out program
public class frmMain extends javax.swing.JFrame {
    //Defining Class Variables

    private final ImageIcon mp3Icon = new ImageIcon(getClass().getResource("/myIcons/16x16/mp3Icon.png"));
    private final ImageIcon VideoIcon = new ImageIcon(getClass().getResource("/myIcons/16x16/videoIcon.png"));
    private final ImageIcon OthersIcon = new ImageIcon(getClass().getResource("/myIcons/16x16/otherfilesIcon.png"));
    static String Path = null;
    //Original check sum which will be taken from Content Advertisement
    //to make sure download is not corrupted
    static String OriginalCheckSum = "unknown";
    static String myFileName = null;
    //Classes that needed to launch into jxta, share contenets through JXTA network,
    //Search for content, Download content, Chat services and Peers Listing in Group
    static StartJXTA connection = null;
    static ChatInput chatIn = null;
    static ChatOutput chatOut = null;
    static PeersListing peersList = null;
    static SaEeDSharing launchSharing = null;
    static SearchFile startSearch = null;
    static DownloadFile download = null;
    static CheckSumCalc myCheckSum = new CheckSumCalc();
    static ContentAdvertisement[] contentAdv = null;

    public frmMain() //Main Frame Constructor 
    {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        txtFilename = new javax.swing.JTextField();
        jScrollPane2 = new javax.swing.JScrollPane();
        mySearchTable = new javax.swing.JTable();
        jSeparator3 = new javax.swing.JSeparator();
        btnSearch = new javax.swing.JButton();
        btnStop = new javax.swing.JButton();
        btnDownload = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        mySharedTable = new javax.swing.JTable();
        jSeparator4 = new javax.swing.JSeparator();
        btnReload = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        lblFilename = new javax.swing.JLabel();
        lblStatus = new javax.swing.JLabel();
        myProgressBar = new javax.swing.JProgressBar();
        btnVerify = new javax.swing.JButton();
        btnCancel = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        txtChatArea = new javax.swing.JTextArea();
        jSeparator5 = new javax.swing.JSeparator();
        jLabel5 = new javax.swing.JLabel();
        txtMessage = new javax.swing.JTextField();
        btnSendMessage = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        ListOfPeers = new javax.swing.JList();
        jSeparator6 = new javax.swing.JSeparator();
        btnFindPeers = new javax.swing.JButton();
        btnStopPeerSearch = new javax.swing.JButton();
        jLabel6 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        txtLog = new javax.swing.JTextArea();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        MenuItemConnect = new javax.swing.JMenuItem();
        MenuItemDisconnect = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JSeparator();
        MenuItemExit = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenu4 = new javax.swing.JMenu();
        ItemWindowStyle = new javax.swing.JMenuItem();
        ItemSwingStyle = new javax.swing.JMenuItem();
        ItemOthersStyle = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        ItemAboutMe = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("SaEeD P2P File Sharing Application V0.01");
        setLocationByPlatform(true);

        jTabbedPane1.setTabPlacement(javax.swing.JTabbedPane.LEFT);
        jTabbedPane1.setToolTipText("");

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Search for Files:"));

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel1.setText("File Name:");

        txtFilename.setToolTipText("Enter File Name to search for.");

        mySearchTable.setAutoCreateRowSorter(true);
        mySearchTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "File Name", "Size Bytes", "Check Sum (CRC-32)"
            }
        ));
        mySearchTable.setToolTipText("List of Found Files.");
        jScrollPane2.setViewportView(mySearchTable);

        btnSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/myIcons/24x24/searchIcon.png"))); // NOI18N
        btnSearch.setText("Search");
        btnSearch.setToolTipText("Start Searching");
        btnSearch.addActionListener(new java.awt.event.ActionListener() {
            @Override
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSearchActionPerformed(evt);
            }
        });

        btnStop.setIcon(new javax.swing.ImageIcon(getClass().getResource("/myIcons/24x24/cancelIcon.png"))); // NOI18N
        btnStop.setText("Stop");
        btnStop.setToolTipText("Stop searching progress");
        btnStop.setEnabled(false);
        btnStop.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnStopActionPerformed(evt);
            }
        });

        btnDownload.setIcon(new javax.swing.ImageIcon(getClass().getResource("/myIcons/24x24/saveIcon.png"))); // NOI18N
        btnDownload.setText("Download");
        btnDownload.setToolTipText("Downloading Selected File.");
        btnDownload.setEnabled(false);
        btnDownload.addActionListener(new java.awt.event.ActionListener() {
            @Override
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDownloadActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2)
                    .addComponent(jSeparator3, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtFilename, javax.swing.GroupLayout.PREFERRED_SIZE, 356, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(btnSearch)
                        .addGap(4, 4, 4)
                        .addComponent(btnDownload, javax.swing.GroupLayout.PREFERRED_SIZE, 525, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnStop, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(txtFilename, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 313, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 13, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnDownload)
                    .addComponent(btnSearch)
                    .addComponent(btnStop))
                .addContainerGap(89, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Buscar", new javax.swing.ImageIcon(getClass().getResource("/myIcons/24x24/searchIcon2.png")), jPanel2, "Search for Shared Files."); // NOI18N

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("List of Shared Files:"));

        mySharedTable.setAutoCreateRowSorter(true);
        mySharedTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Type", "File Name", "Size Bytes", "Check Sum (CRC-32)"
            }
        ));
        mySharedTable.setToolTipText("My Shared Files");
        jScrollPane3.setViewportView(mySharedTable);

        btnReload.setIcon(new javax.swing.ImageIcon(getClass().getResource("/myIcons/24x24/reloadIcon.png"))); // NOI18N
        btnReload.setMnemonic('R');
        btnReload.setText("Reload");
        btnReload.setToolTipText("Refreshing Shared Files.");
        btnReload.addActionListener(new java.awt.event.ActionListener() {
            @Override
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnReloadActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSeparator4, javax.swing.GroupLayout.DEFAULT_SIZE, 806, Short.MAX_VALUE)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 782, Short.MAX_VALUE)
                    .addComponent(btnReload, javax.swing.GroupLayout.DEFAULT_SIZE, 782, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 382, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator4, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnReload)
                .addContainerGap(87, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Shared Files", new javax.swing.ImageIcon(getClass().getResource("/myIcons/24x24/folderIcon.png")), jPanel3, "List of Shared Files"); // NOI18N

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Download Status:"));

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel2.setText("File Name:");

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel3.setText("Status:");

        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel4.setText("Complited:");

        lblFilename.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        lblFilename.setForeground(new java.awt.Color(153, 0, 0));
        lblFilename.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblFilename.setText("None");
        lblFilename.setToolTipText("Downloading file name");
        lblFilename.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        lblStatus.setForeground(new java.awt.Color(0, 0, 153));
        lblStatus.setText("Waiting.....");
        lblStatus.setToolTipText("Status of current download");

        myProgressBar.setStringPainted(true);

        btnVerify.setIcon(new javax.swing.ImageIcon(getClass().getResource("/myIcons/16x16/varifyIcon.png"))); // NOI18N
        btnVerify.setText("Verify");
        btnVerify.setToolTipText("Verify Downloaded File");
        btnVerify.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVerifyActionPerformed(evt);
            }
        });

        btnCancel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/myIcons/16x16/cancelIcon.png"))); // NOI18N
        btnCancel.setText("Cancel");
        btnCancel.setToolTipText("Cancel Download");
        btnCancel.setEnabled(false);
        btnCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(myProgressBar, javax.swing.GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE)
                    .addComponent(lblStatus, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(lblFilename, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 313, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(btnVerify, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnCancel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(316, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(lblFilename)
                    .addComponent(btnVerify))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(lblStatus))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(myProgressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnCancel))
                .addContainerGap(421, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Downloads", new javax.swing.ImageIcon(getClass().getResource("/myIcons/24x24/downloadIcon.png")), jPanel4, "Downloads Status"); // NOI18N

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Peers Chatting Service:"));

        txtChatArea.setEditable(false);
        txtChatArea.setColumns(20);
        txtChatArea.setRows(5);
        txtChatArea.setToolTipText("Chat Area");
        jScrollPane4.setViewportView(txtChatArea);

        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel5.setText("Enter Message:");

        txtMessage.setToolTipText("Enter Message Here");
        txtMessage.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtMessageActionPerformed(evt);
            }
        });

        btnSendMessage.setIcon(new javax.swing.ImageIcon(getClass().getResource("/myIcons/24x24/launchIcon.png"))); // NOI18N
        btnSendMessage.setMnemonic('S');
        btnSendMessage.setText("Send");
        btnSendMessage.setToolTipText("Sending Message");
        btnSendMessage.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSendMessageActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator5, javax.swing.GroupLayout.DEFAULT_SIZE, 782, Short.MAX_VALUE)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 782, Short.MAX_VALUE)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtMessage, javax.swing.GroupLayout.PREFERRED_SIZE, 481, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnSendMessage, javax.swing.GroupLayout.DEFAULT_SIZE, 184, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 371, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator5, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(txtMessage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnSendMessage))
                .addContainerGap(98, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Chat", new javax.swing.ImageIcon(getClass().getResource("/myIcons/24x24/MessengerIcon.png")), jPanel5, "Peers Messenger"); // NOI18N

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Listing Peers In Current Group"));

        ListOfPeers.setBorder(javax.swing.BorderFactory.createTitledBorder("Peers Name:"));
        ListOfPeers.setToolTipText("Peers in SaEeD Group");
        jScrollPane5.setViewportView(ListOfPeers);

        jSeparator6.setOrientation(javax.swing.SwingConstants.VERTICAL);

        btnFindPeers.setIcon(new javax.swing.ImageIcon(getClass().getResource("/myIcons/24x24/searchIcon2.png"))); // NOI18N
        btnFindPeers.setText("Find Peers");
        btnFindPeers.setToolTipText("Start Searching for Peers in SaEeD Group");
        btnFindPeers.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFindPeersActionPerformed(evt);
            }
        });

        btnStopPeerSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/myIcons/24x24/cancelIcon.png"))); // NOI18N
        btnStopPeerSearch.setText("Stop");
        btnStopPeerSearch.setToolTipText("Stop Searching for Peers");
        btnStopPeerSearch.setEnabled(false);
        btnStopPeerSearch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnStopPeerSearchActionPerformed(evt);
            }
        });

        jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/myIcons/24x24/progress_bar.gif"))); // NOI18N

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, 782, Short.MAX_VALUE)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jSeparator6, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(btnStopPeerSearch, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btnFindPeers, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator6, javax.swing.GroupLayout.DEFAULT_SIZE, 453, Short.MAX_VALUE)
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 482, Short.MAX_VALUE)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(btnFindPeers)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 381, Short.MAX_VALUE)
                        .addComponent(btnStopPeerSearch)))
                .addGap(26, 26, 26)
                .addComponent(jLabel6)
                .addContainerGap())
        );

        jTabbedPane1.addTab("List Of Peers", new javax.swing.ImageIcon(getClass().getResource("/myIcons/24x24/sysinfoIcon.png")), jPanel6, "Listing Peers in Group"); // NOI18N

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Connection Information:"));

        txtLog.setEditable(false);
        txtLog.setColumns(20);
        txtLog.setRows(5);
        txtLog.setText("===== Welcome to SaEeD's Peer-To-Peer File Sharing Application =====\n");
        txtLog.setToolTipText("Connection Information");
        txtLog.setBorder(javax.swing.BorderFactory.createTitledBorder("Log:"));
        jScrollPane1.setViewportView(txtLog);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 806, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 508, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Info Conexão", new javax.swing.ImageIcon(getClass().getResource("/myIcons/24x24/LogIcon.png")), jPanel1, "Connection Information"); // NOI18N

        jMenu1.setMnemonic('F');
        jMenu1.setText("File");

        MenuItemConnect.setIcon(new javax.swing.ImageIcon(getClass().getResource("/myIcons/16x16/connectIcon.png"))); // NOI18N
        MenuItemConnect.setMnemonic('C');
        MenuItemConnect.setText("Connect");
        MenuItemConnect.setEnabled(false);
        MenuItemConnect.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MenuItemConnectActionPerformed(evt);
            }
        });
        jMenu1.add(MenuItemConnect);

        MenuItemDisconnect.setIcon(new javax.swing.ImageIcon(getClass().getResource("/myIcons/16x16/disconnectIcon.png"))); // NOI18N
        MenuItemDisconnect.setText("Disconnect");
        MenuItemDisconnect.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MenuItemDisconnectActionPerformed(evt);
            }
        });
        jMenu1.add(MenuItemDisconnect);
        jMenu1.add(jSeparator1);

        MenuItemExit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/myIcons/16x16/exitIcon.png"))); // NOI18N
        MenuItemExit.setMnemonic('X');
        MenuItemExit.setText("Exit");
        MenuItemExit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MenuItemExitActionPerformed(evt);
            }
        });
        jMenu1.add(MenuItemExit);

        jMenuBar1.add(jMenu1);

        jMenu2.setMnemonic('V');
        jMenu2.setText("View");

        jMenu4.setText("Window Style");

        ItemWindowStyle.setText("Windows Look");
        ItemWindowStyle.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ItemWindowStyleActionPerformed(evt);
            }
        });
        jMenu4.add(ItemWindowStyle);

        ItemSwingStyle.setText("Swing Look");
        ItemSwingStyle.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ItemSwingStyleActionPerformed(evt);
            }
        });
        jMenu4.add(ItemSwingStyle);

        ItemOthersStyle.setText("Others Look");
        ItemOthersStyle.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ItemOthersStyleActionPerformed(evt);
            }
        });
        jMenu4.add(ItemOthersStyle);

        jMenu2.add(jMenu4);

        jMenuBar1.add(jMenu2);

        jMenu3.setMnemonic('H');
        jMenu3.setText("Help");

        ItemAboutMe.setIcon(new javax.swing.ImageIcon(getClass().getResource("/myIcons/16x16/helpIcon.png"))); // NOI18N
        ItemAboutMe.setMnemonic('A');
        ItemAboutMe.setText("About Me");
        ItemAboutMe.setToolTipText("About Me!");
        ItemAboutMe.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ItemAboutMeActionPerformed(evt);
            }
        });
        jMenu3.add(ItemAboutMe);

        jMenuBar1.add(jMenu3);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1)
                .addContainerGap())
        );

        getAccessibleContext().setAccessibleName("P2P FileSharing");

        pack();
    }

    private void MenuItemConnectActionPerformed(java.awt.event.ActionEvent evt) {
// initializing all needed obejcts and reconnect to JXTA network
        MenuItemConnect.setEnabled(false);

        //Starting Chat Services, which includes chat input and Output using the same pipe.
        chatIn = new ChatInput(connection.getSaEeDGroup(), this.txtLog, this.txtChatArea);
        chatIn.startListening();
        chatOut = new ChatOutput(connection.getSaEeDGroup(), this.txtLog, this.txtChatArea);
        chatOut.start();

        //initializing the PeersListing class to be able to find peers in SaEeDGroup
        peersList = new PeersListing(connection.getSaEeDGroup(), this.txtLog, this.ListOfPeers);

        //Start Sharing Services
        File myPath = new File(Path);
        launchSharing = new SaEeDSharing(connection.getSaEeDGroup(), this.txtLog, myPath);
        //Starting the Sharing Thread
        launchSharing.start();

    }

    private void MenuItemDisconnectActionPerformed(java.awt.event.ActionEvent evt) {
// finalizing all Objects

        MenuItemConnect.setEnabled(true);
        launchSharing.stopCMS();
        launchSharing = null;
        chatIn.stopListening();
        chatIn = null;
        chatOut = null;
        peersList = null;

    }

    private void MenuItemExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MenuItemExitActionPerformed
        //Exiting 
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                txtLog.append("[+] Até mais!! =D");
            }
        });
        System.exit(0);
    }//GEN-LAST:event_MenuItemExitActionPerformed

    private void ItemOthersStyleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ItemOthersStyleActionPerformed
        //Changing to Other Style Frame
        try {
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
            SwingUtilities.updateComponentTreeUI(this); //=====> Repaint the whole Frame !!!!!!!        
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
            System.err.println("Unable to change");
        }
    }//GEN-LAST:event_ItemOthersStyleActionPerformed

    private void ItemSwingStyleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ItemSwingStyleActionPerformed
        //Changing to Swing Default Frame Style
        try {
            UIManager.setLookAndFeel(new MetalLookAndFeel());
            SwingUtilities.updateComponentTreeUI(this); //=====> Repaint the whole Frame !!!!!!!!!        
        } catch (Exception e) {
            System.err.println("Unable to change");
        }
    }//GEN-LAST:event_ItemSwingStyleActionPerformed

    private void ItemWindowStyleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ItemWindowStyleActionPerformed
        //changing to Windows Style Fram
        try {
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
            SwingUtilities.updateComponentTreeUI(this); //=====> Repaint the whole Frame !!!!!!!        
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
            System.err.println("Unable to change");
        }
    }//GEN-LAST:event_ItemWindowStyleActionPerformed

    private void ItemAboutMeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ItemAboutMeActionPerformed
    }//GEN-LAST:event_ItemAboutMeActionPerformed

    private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed
        //Canceling the current Download
        download.myDonwloader.cancel();
        lblStatus.setText("Download Canceled.");
        myProgressBar.setValue(0);
        btnCancel.setEnabled(false);
    }//GEN-LAST:event_btnCancelActionPerformed

    private void btnVerifyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVerifyActionPerformed
        //Create Check sum for downloaded file and check it with original check sum
        // to make sure download was successfull.
        if (download.myDonwloader.isDone()) {
            File myNewFile = new File(Path + File.separator + myFileName);
            String newSum = myCheckSum.getFileSum(myNewFile);
            if (newSum.equals(OriginalCheckSum)) {
                lblStatus.setText("File Verification passed. Download was Successfull.");
            } else {
                lblStatus.setText("File Verification NOT passed-- Download corrupted.");
                JOptionPane.showMessageDialog(null, "CheckSum verification NOT passed.\nDownload Corrupted.", "Failure",
                        JOptionPane.ERROR_MESSAGE);
            }

        } else {
            JOptionPane.showMessageDialog(null, "Download is not finished yet.\nPlease be patient...", "Error",
                    JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_btnVerifyActionPerformed

    private void btnReloadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnReloadActionPerformed
        //Listing the Files in Shared Directory
        File dir = new File(Path);
        File[] listOfFiles = dir.listFiles();
        String[] titles = {"Type", "File Name", "Size Bytes", "Check Sum (CRC-32)"};
        int NumOfFiles = 0;
        for (int i = 0; i < listOfFiles.length; i++) {
            if (listOfFiles[i].isFile()) {
                NumOfFiles++;
            }
        }

        DefaultTableModel TableModel1 = new DefaultTableModel(titles, NumOfFiles) {
            @Override
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        };
        mySharedTable.setModel(TableModel1);

        //This table render is used to show file type icons in Table
        TableCellRenderer iconHeaderRenderer = new DefaultTableCellRenderer() {
            @Override
            public Component getTableCellRendererComponent(JTable table, Object value,
                    boolean isSelected, boolean hasFocus, int row, int column) {
                // Inherit the colors and font from the header component
                if (table != null) {
                    JTableHeader header = table.getTableHeader();
                    if (header != null) {
                        setForeground(header.getForeground());
                        setBackground(header.getBackground());
                        setFont(header.getFont());
                    }
                }
                if (value != null) {
                    setIcon((ImageIcon) value);
                } else {
                    setText((value == null) ? "" : value.toString());
                    setIcon(null);
                }
                setBorder(UIManager.getBorder("TableHeader.cellBorder"));
                setHorizontalAlignment(JLabel.CENTER);
                return this;
            }
        };

        //Setting new Table render to our table
        mySharedTable.getColumnModel().getColumn(0).setCellRenderer(iconHeaderRenderer);

        int j = 0;
        for (int i = 0; i < listOfFiles.length; i++) { //Showing different icons for different file type
            if (listOfFiles[i].isFile()) {
                if (listOfFiles[i].getName().endsWith(".mp3") || listOfFiles[i].getName().endsWith(".MP3")
                        || listOfFiles[i].getName().endsWith(".wma") || listOfFiles[i].getName().endsWith(".flac")
                        || listOfFiles[i].getName().endsWith(".wav") || listOfFiles[i].getName().endsWith(".m4a")) {
                    mySharedTable.setValueAt(mp3Icon, j, 0);

                } else if (listOfFiles[i].getName().endsWith(".avi") || listOfFiles[i].getName().endsWith(".mpg")
                        || listOfFiles[i].getName().endsWith(".mpeg") || listOfFiles[i].getName().endsWith(".wmv")) {
                    mySharedTable.setValueAt(VideoIcon, j, 0);
                } else {
                    mySharedTable.setValueAt(OthersIcon, j, 0);
                }
                mySharedTable.setValueAt(listOfFiles[i].getName(), j, 1);
                mySharedTable.setValueAt(listOfFiles[i].length(), j, 2);
                mySharedTable.setValueAt(myCheckSum.getFileSum(listOfFiles[i]), j, 3);
                j++;
            }
        }

    }//GEN-LAST:event_btnReloadActionPerformed

    private void btnDownloadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDownloadActionPerformed
        //Start Downloading the Files
        int rowNum;
        if ((rowNum = mySearchTable.getSelectedRow()) != -1) {
            if (contentAdv != null) {
                OriginalCheckSum = mySearchTable.getValueAt(rowNum, 2).toString();
                myFileName = mySearchTable.getValueAt(rowNum, 0).toString();
                lblFilename.setText(myFileName);
                lblStatus.setText("Downloading.....");
                //initializing the file
                File saveTo = new File(Path + File.separator + myFileName);
                //starting Download
                download = new DownloadFile(connection.getSaEeDGroup(), contentAdv[rowNum],
                        saveTo, this.txtLog, this.myProgressBar);
                download.start();
                btnCancel.setEnabled(true);
            }

        } else {
            JOptionPane.showMessageDialog(null, "Please select Row first then Press Download!", "Error",
                    JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_btnDownloadActionPerformed

    private void btnStopActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnStopActionPerformed
        //Stoping the Search for content progress and reinitialize the Search class for furthure useage
        startSearch.killThread();
        //obtaining the ContentAdvertisements
        contentAdv = ListRequestor.searchResult;
        startSearch = null;
        btnSearch.setEnabled(true);
        btnDownload.setEnabled(true);
        btnStop.setEnabled(false);
    }//GEN-LAST:event_btnStopActionPerformed

    private void btnSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSearchActionPerformed
        //Start Searching for contents in Peer Group
        startSearch = new SearchFile(connection.getSaEeDGroup(), this.txtFilename.getText(), this.txtLog,
                this.mySearchTable);
        startSearch.start();
        btnSearch.setEnabled(false);
        btnStop.setEnabled(true);
        btnDownload.setEnabled(false);
    }//GEN-LAST:event_btnSearchActionPerformed

    private void btnSendMessageActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSendMessageActionPerformed
        //Sending Chat message through the pipe
        //Because we using the same pipe for input and output first we need to stop input pipe
        // then send our message then again activate our input pipe
        chatIn.stopListening();
        chatOut.setMessage(txtMessage.getText());
        chatOut.startingPipe();
        //activating the Input pipe again
        chatIn.startListening();
        txtMessage.setText("");
    }//GEN-LAST:event_btnSendMessageActionPerformed

    private void txtMessageActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtMessageActionPerformed
        btnSendMessageActionPerformed(evt);
    }//GEN-LAST:event_txtMessageActionPerformed

    private void btnStopPeerSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnStopPeerSearchActionPerformed
        //Ending Peer Search Thread
        //We need to initialize the PeersListing class again because we ended its  thread
        btnFindPeers.setEnabled(true);
        peersList.setEndOfSearch(true);
        peersList = new PeersListing(connection.getSaEeDGroup(), this.txtLog, this.ListOfPeers);
        btnStopPeerSearch.setEnabled(false);
    }//GEN-LAST:event_btnStopPeerSearchActionPerformed

    private void btnFindPeersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFindPeersActionPerformed
        //Start finding peers in SaEeD's Group
        peersList.start();
        btnFindPeers.setEnabled(false);
        btnStopPeerSearch.setEnabled(true);
    }//GEN-LAST:event_btnFindPeersActionPerformed

    //Executing the Main code and initialising the Objects used in out program
    public static void main(String args[]) {
        frmMain myapp = new frmMain();
        myapp.setVisible(true);

        //first make sure that Terms and Conditions are Accepted by User
        FirstTimeCheck checkFirstTime = new FirstTimeCheck(myapp.txtLog);
        //Search for Configuration file, it not found assumes that it is the first time
        //that we are using this Application
        if (checkFirstTime.isFirstTime()) {
            JOptionPane.showMessageDialog(null, "Please Select Folder to Share", "First Time Configuration",
                    JOptionPane.INFORMATION_MESSAGE);
            checkFirstTime.searchForConfigFile();
            Path = checkFirstTime.getSharedPath();
        } else {
            checkFirstTime.searchForConfigFile();
            Path = checkFirstTime.getSharedPath();
        }
        //Launching JXTA 
        connection = new StartJXTA(myapp.txtLog);
        //Starting Chat Services, which includes chat input and Output using the same pipe.
        chatIn = new ChatInput(connection.getSaEeDGroup(), myapp.txtLog, myapp.txtChatArea);
        chatIn.startListening();
        chatOut = new ChatOutput(connection.getSaEeDGroup(), myapp.txtLog, myapp.txtChatArea);
        chatOut.start();

        //initializing the PeersListing class to be able to find peers in SaEeDGroup
        peersList = new PeersListing(connection.getSaEeDGroup(), myapp.txtLog, myapp.ListOfPeers);

        //Atualiza a primeira a vez a pasta


        //Start Sharing Services
        File myPath = new File(Path);
        launchSharing = new SaEeDSharing(connection.getSaEeDGroup(), myapp.txtLog, myPath);
        //Starting the Sharing Thread
        launchSharing.start();


    }
    
    private javax.swing.JMenuItem ItemAboutMe;
    private javax.swing.JMenuItem ItemOthersStyle;
    private javax.swing.JMenuItem ItemSwingStyle;
    private javax.swing.JMenuItem ItemWindowStyle;
    public javax.swing.JList ListOfPeers;
    private javax.swing.JMenuItem MenuItemConnect;
    private javax.swing.JMenuItem MenuItemDisconnect;
    private javax.swing.JMenuItem MenuItemExit;
    private javax.swing.JButton btnCancel;
    private javax.swing.JButton btnDownload;
    private javax.swing.JButton btnFindPeers;
    private javax.swing.JButton btnReload;
    private javax.swing.JButton btnSearch;
    private javax.swing.JButton btnSendMessage;
    private javax.swing.JButton btnStop;
    private javax.swing.JButton btnStopPeerSearch;
    private javax.swing.JButton btnVerify;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JSeparator jSeparator4;
    private javax.swing.JSeparator jSeparator5;
    private javax.swing.JSeparator jSeparator6;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JLabel lblFilename;
    private javax.swing.JLabel lblStatus;
    public javax.swing.JProgressBar myProgressBar;
    public javax.swing.JTable mySearchTable;
    private javax.swing.JTable mySharedTable;
    public javax.swing.JTextArea txtChatArea;
    private javax.swing.JTextField txtFilename;
    public javax.swing.JTextArea txtLog;
    private javax.swing.JTextField txtMessage;
    
}
